﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BrokerBase.Lib.Policy;

namespace broker.duty.XHRS
{
    class Class4
    {
        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            const double baseamt= 10000d;
            if (ppa.SchemePeriodActing.InsurantStates.Contains("住院") )
            {
                int day=Convert.ToInt32(ppa.SchemePeriodActing.SchemeActing.GetAuxConfigValue("住院天数"));
                da.Value = (ppa.Amount / baseamt) * 20 * day;
            }

        }

        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            const double baseamt = 10000d;
            if (ppa.SchemePeriodActing.InsurantStates.Contains("住院"))
            {
                da.Value = (ppa.Amount / baseamt) * 300;
                da.Description = "最大支付";
            }

        }

        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.SchemePeriodActing.InsurantStates.Contains("住院"))
            {
                int fee = Convert.ToInt32(ppa.SchemePeriodActing.SchemeActing.GetAuxConfigValue("手术及杂费金额"));

                if (fee > 500)
                {
                    da.Value = fee > ppa.Amount ? ppa.Amount : fee;
                }
            }

        }
    }
}
